//
//  Category.swift
//  SinaWebo
//
//  Created by mis on 16/3/21.
//  Copyright © 2016年 mis. All rights reserved.
//

import UIKit


extension UILabel {
    convenience init(title: String,size: CGFloat,color: UIColor,margin: CGFloat = 0) {
        self.init()
        text = title
        textAlignment = .Center
        font = UIFont.systemFontOfSize(size)
        textColor = color
        numberOfLines = 0
        if margin != 0 {
            preferredMaxLayoutWidth = screenW - 2 * margin
            textAlignment = .Left
        }
        sizeToFit()
    }
}